package net.zoneland.knowledge.enums;

/**
 * 纠错类型.
 *
 * @author: zmq
 * 2021/9/29
 */
public enum CorrectTypeEnum {
    /**
     * RHC_PERSON.
     */
    RHC_PERSON("RHC_PERSON", "R慧查-人员信息"),

    /**
     * RHW.
     */
    RHW("RHW", "R慧问题库");

    /**
     * 构造.
     * @param value key
     * @param name value
     */
    CorrectTypeEnum(final String value, final String name) {
        this.value = value;
        this.name = name;
    }
    /**
     * key.
     */
    private String value;

    /**
     * label.
     */
    private String name;

    /**
     * .
     *
     * @return value
     */
    public String getValue() {
        return value;
    }

    /**
     * .
     *
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 根据key获取枚举对象.
     * @param value key
     * @return 枚举值
     */
    public static CorrectTypeEnum getByValue(String value) {
        for (CorrectTypeEnum categoryEnum : CorrectTypeEnum.values()) {
            if (categoryEnum.value.equals(value)) {
                return categoryEnum;
            }
        }
        return null;
    }

}
